<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="MainMenu.ascx.cs" Inherits="BCBWEB.MainMenu" %>
<%@ Import Namespace="System.Collections.Generic"%>
<%@ Import Namespace="BCB.BLL"%>
<%@ Import Namespace="BCB.Model"%>

<%@ OutputCache Duration="86400" VaryByParam="none"%>
<div class="horizontalcssmenu">
    <ul id="cssmenu1">
        <%List<CategoryInfo> mainCategories = Category.GetMainCategoies();
        foreach (CategoryInfo mainItem in mainCategories) {%>
            <li><a href='<%=Page.ResolveUrl(GetRedirectUrl(mainItem.CategoryId))%>'><%=mainItem.Name%></a>
            <%List<CategoryInfo> subCategories = Category.GetSubCategories(mainItem.CategoryId);
            if (subCategories.Count > 0) {%>
                <ul>
                <%foreach (CategoryInfo subItem in subCategories) { %>
                    <li><a href='<%=Page.ResolveUrl(GetRedirectUrl(subItem.CategoryId))%>'>
                        <%=subItem.Name%>
                    </a></li>
                <%} %>
                </ul>
            <%} %>
            </li>
        <%} %>
    </ul>
    <br style="clear: left;" />
</div>
